<div id="title_right">
	<p id="title_right_left"></p>
	<div id="title_right_center">
		<p class="chu_title">DANH SÁCH LOẠI HÀNG</p>
	</div>
	<p id="title_right_right"></p>
</div>

<?php if($data){
//var_dump($data['lh']);
?>
<form method="post" action="admin.php?mod=timloaihang">
	<table height="40px" width="200px" style="margin: 10px">
	<tr>
	<td><input name="lh" type="text" ><td>
	<td><input name="tim" type="submit" value="Tìm"></td>
	</tr>
	</table>
	</form>
<table class="table">
	<tr class="mau2">
		<td>STT</td>
		<td>Tên chủng loại</td>
		<td>Tên loại hàng</td>

		<td><img src="public/images/b_edit.png" /> Sửa</td>
		<td><img src="public/images/b_drop.png" /> Xóa</td>
	</tr>
<?php
	$i=1;
	if (is_array(@$data['lh'])){
foreach ($data['lh'] as $key => $value) {

		if($i%2==0){
			echo "<tr class='mau'>";
		}else
		{
			echo "<tr>";
		}
?>
	<td><?php echo $i;?></td>
	<td>
<?php
	if(is_array($data['listcl'])){
		foreach ($data['listcl'] as $item){
			if($item['MaCL']==$value['MaCL']){
				echo $item['TenCL'];
			}
		}
	}
?>
	</td>
	<td><?php echo $value['TenLH'];?></td>

	<td><a href="admin.php?mod=updateloaihang&ma=<?php echo $value['MaLH']?>">Sửa </a></td>
	<td><a href="admin.php?mod=delloaihang&ma=<?php echo $value['MaLH']?>">Xóa </a></td>
	</tr>
<?php
$i++;
}
	}
?>
	<tr>
		<td colspan="8">
			<button onclick="window.location.href='admin.php?mod=addloaihang'">Thêm mới</button></td>
	</tr>
</table>
<?php }

	
?>
